package org.devside.common.utils;

import java.io.PrintWriter;
import java.io.StringWriter;

/**
 * 异常工具类
 * Date: 2010-6-6
 *
 * @author zjumty@gmail.com
 */
public final class ExceptionUtils {
    private ExceptionUtils() {

    }


    /**
     * 取得异常栈内容
     * @param e 异常
     * @return 栈内容
     */
    public static String getErrorStack(Exception e) {
        StringWriter sw = new StringWriter();
        PrintWriter out = new PrintWriter(sw);
        e.printStackTrace(out);
        return sw.toString();
    }
}
